package concurrent.completableFuture;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.TimeUnit;

/**
 * @author shanzhenbo
 */
public class MedalService {

	public MedalInfo getMedalInfo(Integer id) {
		try {
			TimeUnit.SECONDS.sleep(3);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println(Thread.currentThread().getName() + "-获取荣誉成功");
		return new MedalInfo(1, "荣誉※", 1, 5);
	}

	public void insertMedal(String title, Integer userId, Integer level) {
		try {
			TimeUnit.SECONDS.sleep(3);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println(Thread.currentThread().getName() + "新增荣誉成功");
	}

	public void addMedalLevel(Integer id, Integer level) {
		try {
			TimeUnit.SECONDS.sleep(3);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println(Thread.currentThread().getName() + "荣誉等级提升成功");
	}

}

